home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / internet / ncftp2b6.zip / NCFTP.MAN < prev    next >
Text File  |  1996-01-13  |  57KB  |  1,301 lines

  1.  
  2.  
  3. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  4.  
  5.  
  6. NNNAAAMMMEEE
  7.      NcFTP - Internet file transfer program
  8.  
  9. SSSYYYNNNOOOPPPSSSIIISSS
  10.      nnncccffftttppp [_p_r_o_g_r_a_m _o_p_t_i_o_n_s] [[_o_p_e_n _o_p_t_i_o_n_s] _h_o_s_t_n_a_m_e[:::_p_a_t_h_n_a_m_e]]
  11.  
  12. OOOPPPTTTIIIOOONNNSSS
  13.  
  14.      Program options:
  15.        -D   : Turn debug mode and trace mode on.
  16.        -L   : Don't use visual mode (use line mode).
  17.        -V   : Use visual mode.
  18.        -H   : Dump the version information.
  19.  
  20.      Command-line open options:
  21.        -a   : Open anonymously.
  22.        -u   : Open with username and password prompt.
  23.        -p X : Use port number X when opening.
  24.        -r   : Redial until connected.
  25.        -d X : Redial, delaying X seconds between tries.
  26.        -g X : Give up after X redials without connection.
  27.  
  28.      Command-line retrieve options:
  29.        -C   : Force continuation (reget).
  30.        -f   : Force overwrite.
  31.        -G   : Don't use wildcard matching.
  32.        -R   : Recursive.  Useful for fetching whole directories.
  33.        -n X : Get selected files only if X days old or newer.
  34.  
  35. DDDEEESSSCCCRRRIIIPPPTTTIIIOOONNN
  36.      _N_c_F_T_P is  a  user  interface  to  the  Internet  standard  _F_i_l_e  _T_r_a_n_s_f_e_r
  37.      _P_r_o_t_o_c_o_l.   This  program  allows  a user to transfer files to and from a
  38.      remote network site, and offers additional features that are not found in
  39.      the standard interface, _f_t_p.
  40.  
  41.      The program runs in one of three modes:   _v_i_s_u_a_l  _m_o_d_e,  _l_i_n_e  _m_o_d_e,  and
  42.      _c_o_l_o_n _m_o_d_e.
  43.  
  44.      If your system is somewhat modern, the  default  mode  should  be  _v_i_s_u_a_l
  45.      _m_o_d_e.   This  is  a  full-screen  interface that uses the _c_u_r_s_e_s library.
  46.      With visual mode, you edit the program's  settings  with  a  nice  screen
  47.      interface instead of typing arcane commands.
  48.  
  49.      If you are not in visual mode, you  will  be  using  _l_i_n_e  _m_o_d_e  for  the
  50.      interactive  shell.  This mode is a no-frills command-line interface that
  51.      will look like the default _f_t_p program's command shell.
  52.  
  53.      The third mode, _c_o_l_o_n _m_o_d_e, refers to the program's ability to do a quick
  54.      retrieve  of  a file directly from your shell command line, without going
  55.      into the program's own shell.  This mode is useful for shell scripts.
  56.  
  57. IIINNNTTTRRROOODDDUUUCCCTTTIIIOOONNN TTTOOO VVVIIISSSUUUAAALLL MMMOOODDDEEE
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.                                     2.3.0                                    1
  65.  
  66.  
  67.  
  68. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  69.  
  70.  
  71.      When entering visual mode, the screen clears and is  rewritten  with  the
  72.      splash  screen.  You should see the black status bar occupying the second
  73.      to last row on the screen.  Beneath the status bar  is  the  input  line,
  74.      where you type commands to the program's shell.
  75.  
  76.      The program then waits for you to do something.  Usually this  means  you
  77.      want to open a remote filesystem to transfer files to and from your local
  78.      machine's filesystem.  To do that, you need to know the symbolic name  of
  79.      the remote system, or its _I_n_t_e_r_n_e_t _P_r_o_t_o_c_o_l (IP) address.  For example, a
  80.      symbolic name might be ``typhoon\.unl\.edu,'' and its IP address could be
  81.      ``129.93.33.24.''   To  open  a  connection  to  that system, you use the
  82.      program's _o_p_e_n command:
  83.  
  84.            open typhoon.unl.edu
  85.            open 129.93.33.24
  86.  
  87.      Both of these try to open the machine called typhoon at the _U_n_i_v_e_r_s_i_t_y _o_f
  88.      _N_e_b_r_a_s_k_a.   Using  the  symbolic  name  is  the preferred way, because IP
  89.      addresses may change without notice, while  the  symbolic  names  usually
  90.      stay the same.
  91.  
  92.      When you open a remote filesystem, you need to have permission.  The  _F_T_P
  93.      _P_r_o_t_o_c_o_l's authentication system is very similar to that of logging in to
  94.      your account.  You have to give an account name,  and  its  password  for
  95.      access  to  that account's files.  However, most remote systems that have
  96.      anything you might be interested in don't require  an  account  name  for
  97.      use.   You  can  often  get  anonymous  access to a remote filesystem and
  98.      exchange files that have been  made  publicly  accessible.   The  program
  99.      attempts to get anonymous permission to a remote system by default.  What
  100.      actually happens is that the program tries to use  ``anonymous''  as  the
  101.      account  name, and when prompted for a password, uses your E-mail address
  102.      as a courtesy to the  remote  system's  maintainer.   You  can  have  the
  103.      program  try  to  use  a  specific  account also.  That will be explained
  104.      later.
  105.  
  106.      If the connection succeeded, you should see the status bar change to hold
  107.      the remote system's name on one side, and the current remote directory on
  108.      the other side.  To see what's in the current remote directory,  you  can
  109.      use  the  program's _l_s and _d_i_r commands.  The former is terse, preferring
  110.      more remote files in less screen space, and the latter is  more  verbose,
  111.      giving detailed information about each item in the directory.
  112.  
  113.      You can use the program's _c_d command to move to other directories on  the
  114.      remote  system.  The cd command behaves very much like the command of the
  115.      same name in the _B_o_u_r_n_e and _K_o_r_n shell.
  116.  
  117.      The purpose of the program is to exchange data with other  systems.   You
  118.      can  use  the program's _g_e_t command to copy a file from the remote system
  119.      to your local system:
  120.  
  121.            get README.txt
  122.  
  123.      The program will display the progress of the transfer on the  screen,  so
  124.      you  can  tell  how  much  needs to be done before the transfer finishes.
  125.      When the transfer does finish, then you can enter more  commands  to  the
  126.      program's command shell.
  127.  
  128.  
  129.                                     2.3.0                                    2
  130.  
  131.  
  132.  
  133. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  134.  
  135.  
  136.      You can use the program's _p_u_t command to copy a file from your system  to
  137.      the remote system:
  138.  
  139.            put something.tar
  140.  
  141.      When you are finished using the remote system, you can open  another  one
  142.      or use the _q_u_i_t command to terminate the program.
  143.  
  144. TTTHHHEEE BBBOOOOOOKKKMMMAAARRRKKKSSS FFFIIILLLEEE
  145.  
  146.      One  of  the  program's  goals  is  to  minimize  typing   and   maximize
  147.      convenience.  The program automatically saves information about the sites
  148.      you call on in a special file called the _b_o_o_k_m_a_r_k_s file, which is  stored
  149.      in  the  ._n_c_f_t_p subdirectory of your home directory.  Each bookmark saves
  150.      the host name along with other settings, including the  remote  directory
  151.      you  were  in,  the account information, and more.  This makes it easy to
  152.      call back a site later and have everything be like it was when  you  left
  153.      the last time.
  154.  
  155.      A big advantage of saving this information is that you  can  refer  to  a
  156.      site  by  a  shorter,  more  meaningful  name,  instead of using the full
  157.      symbolic host name for a site.  For example, if you called a  site  named
  158.      ``typhoon\.unl\.edu''   frequently,  its  bookmark  name  might  be  just
  159.      ``typhoon.''  Then, instead of:
  160.  
  161.            open typhoon.unl.edu
  162.  
  163.      you could use:
  164.  
  165.            open typhoon
  166.  
  167.      You could also abbreviate the bookmark  name  further,  as  long  as  the
  168.      program  will  know  which  site  you  are  referring  to.   If  no other
  169.      bookmark's name starts with the letters ``ty,'' you could do just:
  170.  
  171.            open ty
  172.  
  173.      Use the bookmarking feature to assign mnemonic names to hosts whose  real
  174.      names  don't  give  much hint to what you call there for.  A popular game
  175.      called _N_e_t_h_a_c_k is archived at linc\.cis\.upenn\.edu, in  the  /pub/NH3\.1
  176.      directory.   You  could  assign ``nethack'' as the bookmark name for this
  177.      site.  Then you could try:
  178.  
  179.            open nethack
  180.  
  181.      instead of:
  182.  
  183.            open linc.cis.upenn.edu
  184.  
  185. UUUSSSIIINNNGGG TTTHHHEEE BBBOOOOOOKKKMMMAAARRRKKK EEEDDDIIITTTOOORRR
  186.  
  187.      To manipulate the bookmarks stored in your bookmarks file,  you  use  the
  188.      program's  bookmark  editor.   Run  the  bookmark  editor  by  typing the
  189.      _b_o_o_k_m_a_r_k_s command from within the program.  This brings up a  new  screen
  190.      of information.
  191.  
  192.  
  193.  
  194.                                     2.3.0                                    3
  195.  
  196.  
  197.  
  198. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  199.  
  200.  
  201.      On the right side is the list of remote systems the program has saved for
  202.      you  already.   Each  time  you open a connection to a remote system, the
  203.      program saves an entry in your bookmark file for you  automatically.   If
  204.      you have not opened any sites successfully yet, this list would be empty.
  205.  
  206.      On the left side is some instructions saying what you  can  do  with  the
  207.      list.   The  bookmark  editor  is  waiting  for you to do something, like
  208.      select a bookmark whose settings you want to edit.
  209.  
  210.      Some bookmark editor ``hot key'' commands are one key only.  You  do  not
  211.      need  to  hit  enter  after  the  hot key commands.  To exit the bookmark
  212.      editor for example, you would just type the ``x'' key only.   The  multi-
  213.      key  commands  require  a  slash  first and do require the enter key.  To
  214.      delete the selected site, for example, you would type the ``/'' key, then
  215.      ``del,'' and then the enter key.
  216.  
  217.      You can use the ``d'' key to move down one line  in  the  list,  and  the
  218.      ``u''  key to move up one line.  If you have many entries in the bookmark
  219.      list, you won't be able to see them  all  at  once.   The  bookmark  list
  220.      scrolls as appropriate to bring the other sites into view.  Use the ``p''
  221.      and ``n'' keys to move pages at a time.
  222.  
  223.      Another way to select a site in the bookmark list is to use  the  capital
  224.      letters.  If I had many entries in my bookmark list, but wanted to select
  225.      a site whose bookmark name was ``nethack,'' I could type  ``N''  and  the
  226.      list  would zoom to the first site with bookmark starting with the letter
  227.      ``n.''
  228.  
  229.      After you have hilited a bookmark you want to edit, use the /_e_d  command.
  230.      Doing that brings up another screen with the settings for that bookmark.
  231.  
  232.      In the _B_o_o_k_m_a_r_k _O_p_t_i_o_n_s screen, you use hot keys to select a  setting  to
  233.      edit.   To  edit  the  bookmark  name, for example, you would type ``a.''
  234.      When you are finished editing this bookmark, hit the ``x'' key to  return
  235.      to the bookmark editor's screen.
  236.  
  237. BBBOOOOOOKKKMMMAAARRRKKK OOOPPPTTTIIIOOONNNSSS
  238.  
  239.      Edit the _B_o_o_k_m_a_r_k _n_a_m_e field to change the name you use to open this site
  240.      with.   Remember,  when  you change the bookmark name , you must use this
  241.      name to refer to this  particular  bookmark,  so  if  you  change  it  to
  242.      ``foobar,''  you  need  to use ``open foobar.''  This is required because
  243.      you can have multiple entries for a remote host.  For example, you  could
  244.      have   two  bookmarks  for  wuarchive\.wustl\.edu,  named  ``wumac''  and
  245.      ``wuwindows.''  If you were to  say  ``open  wuarchive\.wustl\.edu,''  it
  246.      would not be clear to the program which host entry to use.
  247.  
  248.      Change the login information for the site by editing the _U_s_e_r,  _P_a_s_s_w_o_r_d,
  249.      and  _A_c_c_o_u_n_t  fields.   Normally  you would want to leave these as is for
  250.      anonymous logins.  Depending on your situation, you might want to  use  a
  251.      specific  account  on  the  remote  system.   This  is one way to get the
  252.      program to use a non-anonymous login.
  253.  
  254.      The _D_i_r_e_c_t_o_r_y field specifies the directory to move  to  upon  successful
  255.      connection  to  the  remote  host  for this bookmark.  When you close the
  256.      site, this field is updated for you automatically to be the directory you
  257.  
  258.  
  259.                                     2.3.0                                    4
  260.  
  261.  
  262.  
  263. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  264.  
  265.  
  266.      were in when you closed the site.
  267.  
  268.      The _T_r_a_n_s_f_e_r _T_y_p_e field can be changed to  use  a  different  translation
  269.      mode  when transferring files.  This program is usually running on a _U_N_I_X
  270.      system, and most remote systems are also _U_N_I_X variants,  so  the  default
  271.      transfer type is _b_i_n_a_r_y, which does no translation at all.
  272.  
  273.      However, when you need to work with plain text files  and  transfer  them
  274.      between  non-_U_N_I_X  systems,  you  can  change  this  to _A_S_C_I_I.  That will
  275.      guarantee that the text-only files will translate correctly.  Most often,
  276.      you will need to use the _b_i_n_a_r_y transfer type.
  277.  
  278.      The _P_o_r_t field can be changed so that the program tries  to  use  a  non-
  279.      standard  port  number.  I have yet to ever need a different port number,
  280.      but this capability is here in case it's needed.
  281.  
  282.      The _H_a_s _S_I_Z_E _C_o_m_m_a_n_d field will probably not need  to  be  edited.   This
  283.      field  is  mostly  for your information only.  The _S_I_Z_E command is an _F_T_P
  284.      _P_r_o_t_o_c_o_l command that  the  program  would  like  the  remote  server  to
  285.      support.   If  it  is  supported,  the program can get an exact number of
  286.      bytes of remote files before transferring.  That is nice to know  so  the
  287.      progress reports work better.
  288.  
  289.      The _H_a_s _M_D_T_M _C_o_m_m_a_n_d field will probably not need to  be  edited  either.
  290.      If  the  remote  server  supports  it,  the  program  can  get  the exact
  291.      modification date of the remote file, and set the local file to the  same
  292.      date.
  293.  
  294.      The _C_a_n _U_s_e _P_a_s_s_i_v_e _F_T_P field specifies whether the remote server  allows
  295.      use of the _F_T_P _P_r_o_t_o_c_o_l's _P_A_S_V command.  There are two ways to set up FTP
  296.      connections.  The default way is what I call  _P_o_r_t  _F_T_P.   Unfortunately,
  297.      _P_o_r_t _F_T_P cannot be used when your local host is hiding behind a _F_i_r_e_w_a_l_l.
  298.      _P_a_s_s_i_v_e _F_T_P can be used with a firewall, and that's why I would  like  to
  299.      use  that  method  if  possible.  You probably will not need to edit this
  300.      field, since this can be detected automatically most of the time.
  301.  
  302.      The _O_p_e_r_a_t_i_n_g _S_y_s_t_e_m field is used by the program to tell if it can  rely
  303.      on  certain  dependencies  to specific operating systems.  If the OS is a
  304.      UNIX variant, the program can make  some  assumptions  about  the  remote
  305.      server's responses.  For example, if the OS is _U_N_I_X, the _l_s command tries
  306.      to use the -_C_F flags, like you could with ``/bin/ls -CF''  on  _U_N_I_X.   If
  307.      the OS wasn't _U_N_I_X, the ``-CF'' might not make sense to the remote server
  308.      and it might complain.  You probably will not need to  edit  this  field,
  309.      since this can be detected automatically most of the time.
  310.  
  311.      The comment field can be used to store  a  brief  description  about  the
  312.      site.   For  example, for my ``nethack'' entry, I could use this field to
  313.      hold ``Archive site for latest version of Nethack.''  When you are in the
  314.      bookmark  editor's window, if you hilite a site that has a comment, it is
  315.      printed at the bottom of the screen so you do not have to edit  the  site
  316.      to look at it.
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.                                     2.3.0                                    5
  325.  
  326.  
  327.  
  328. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  329.  
  330.  
  331. PPPRRREEEFFFEEERRREEENNNCCCEEESSS
  332.  
  333.      In addition to remote-host  specific  options,  the  program  has  global
  334.      options that are user-configurable.  To change the program's preferences,
  335.      run the _p_r_e_f_s command from within the program.
  336.  
  337.      The _D_e_f_a_u_l_t _o_p_e_n _m_o_d_e field specifies how the program should try to  open
  338.      connections.   If you do a lot of anonymous FTPing, you should leave this
  339.      set to _a_n_o_n_y_m_o_u_s.  You might want to set this field to _u_s_e_r & _p_a_s_s_w_o_r_d if
  340.      the  hosts  you  FTP  to  most  often  don't allow anonymous logins.  For
  341.      example, if you are using the program on your  company  network  to  copy
  342.      things  from  different  company  machines,  you  would  not  want to use
  343.      _a_n_o_n_y_m_o_u_s FTP mode.
  344.  
  345.      The _A_n_o_n_y_m_o_u_s _p_a_s_s_w_o_r_d field lets you  change  the  value  given  to  the
  346.      remote  host  when  you  use  an  anonymous  login.  It is customary (and
  347.      sometimes required) to use  your  e-mail  address  as  the  password  for
  348.      anonymous  FTP, so the remote host's administrator knows who is using the
  349.      service.  If the program didn't get your e-mail  address  right,  or  you
  350.      want to use something different, you can change it here.
  351.  
  352.      The program now uses more whitespace than before to reduce eyestrain.  If
  353.      you  prefer,  you  can  turn off that feature by changing the _B_l_a_n_k _l_i_n_e_s
  354.      _b_e_t_w_e_e_n _c_m_d_s field.
  355.  
  356.      The program can log the transfers you do to a file so you  can  refer  to
  357.      the  log  if  you can't remember where you got something.  To turn on the
  358.      log, which is saved as ~/._n_c_f_t_p/_l_o_g, you can set the _U_s_e_r _l_o_g _s_i_z_e  field
  359.      to a number greater than zero.  You probably do not want to let this file
  360.      grow forever, so you set the maximum size of  the  log  by  setting  that
  361.      field.
  362.  
  363.      Although the program is perfectly happy saving every site you  ever  open
  364.      in  the  bookmarks file, you may want to put an upper bound on the number
  365.      of sites saved.  If you have  a  slow  machine,  which  might  cause  the
  366.      program  to  take awhile to load and save the bookmarks, or if disk space
  367.      is at a premium, you can set the _M_a_x _b_o_o_k_m_a_r_k_s _t_o _s_a_v_e field to limit the
  368.      number  of bookmarks saved.  Once that limit is reached, the program will
  369.      discard sites whose time since the last connection is  the  longest.   In
  370.      other words, a site you only called once a long time ago and forgot about
  371.      will be the first to go.
  372.  
  373.      A few program functions need to use a _p_a_g_e_r program to view large amounts
  374.      of  text.  For example, the _p_a_g_e command retrieves a remote file and uses
  375.      the pager to view it.  You can  specify  the  program  to  use  (and  its
  376.      command line flags, if any) by setting the _p_a_g_e_r field.
  377.  
  378.      When you transfer files between the remote host and your local host,  the
  379.      program  uses  a  _p_r_o_g_r_e_s_s  _m_e_t_e_r to show you the status of the transfer.
  380.      The program has a few different progress meters to choose from,  and  you
  381.      can try out the other ones by changing the _P_r_o_g_r_e_s_s _m_e_t_e_r field.
  382.  
  383.      You can control how much of the remote server's  chatter  is  printed  by
  384.      changing  the  _R_e_m_o_t_e  _m_e_s_s_a_g_e_s  field.   The program always prints error
  385.      messages, but most of the time the remote server  doesn't  have  anything
  386.      useful  to  say.   There  are  a  couple  of  messages  that may be worth
  387.  
  388.  
  389.                                     2.3.0                                    6
  390.  
  391.  
  392.  
  393. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  394.  
  395.  
  396.      printing.  The first is the _s_t_a_r_t_u_p _m_e_s_s_a_g_e.  Typically, when you connect
  397.      to  a  server  it  has some important information about the server.  Some
  398.      servers have _c_h_d_i_r _m_e_s_s_a_g_e_s, which are sent  when  you  enter  a  special
  399.      directory.   You  specify whether to print these messages by toggling the
  400.      _R_e_m_o_t_e _m_e_s_s_a_g_e_s field.
  401.  
  402.      By default, the program stays in the same directory you were in when  you
  403.      ran  the program, so that downloads will go in that directory.  I like to
  404.      use a ``download directory'' so that all of my downloads go to a specific
  405.      directory.   This prevents me from exceeding my quota, and overwriting my
  406.      other files.  You can set the _S_t_a_r_t_u_p _i_n _L_o_c_a_l  _D_i_r  field  to  have  the
  407.      program  change the local directory each time when the program starts up.
  408.      Then you know where to expect your downloads to end up.
  409.  
  410.      The program itself has some messages which you may get tired of and  want
  411.      to  turn  off.   You  can  change  the  _S_t_a_r_t_u_p _m_e_s_s_a_g_e_s field to specify
  412.      whether the program prints its ``splash screen'' and whether it prints  a
  413.      _t_i_p on how to maximize use of the program.
  414.  
  415.      When you retrieve a remote file, by default the program tries to also set
  416.      the  exact  modification  time of the local file as the remote file.  You
  417.      can turn that off by changing the _F_i_l_e _t_i_m_e_s_t_a_m_p_s field.
  418.  
  419.      If you don't like the full-screen graphics, you can use the line-oriented
  420.      mode  by  changing  the _S_c_r_e_e_n _g_r_a_p_h_i_c_s field.  Once you turn _v_i_s_u_a_l mode
  421.      off from the _P_r_e_f_e_r_e_n_c_e_s screen, you won't be able to  get  back  to  the
  422.      preferences  screen  again when using _l_i_n_e mode.  To get back into visual
  423.      mode, you can run the program with the ``-V'' flag, like:
  424.  
  425.            ncftp -V
  426.  
  427. CCCOOOMMMMMMAAANNNDDD RRREEEFFFEEERRREEENNNCCCEEE
  428.      I will now  describe  the  commands  that  the  program's  command  shell
  429.      supports.  The first command to know is _h_e_l_p.  If you just type
  430.  
  431.            help
  432.  
  433.      from the command shell, the program  prints  the  names  of  all  of  the
  434.      supported  commands.  From there, you can get specific help for a command
  435.      by typing the command after, for example:
  436.  
  437.            help open
  438.  
  439.      prints information about the _o_p_e_n command.
  440.  
  441.      The shell escape command is simply the exclamation point, !  To  spawn  a
  442.      shell, just do:
  443.  
  444.            !
  445.  
  446.      You can also use this to do one command only, like:
  447.  
  448.            !date +%H:%M:%S
  449.  
  450.  
  451.  
  452.  
  453.  
  454.                                     2.3.0                                    7
  455.  
  456.  
  457.  
  458. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  459.  
  460.  
  461.      The _c_d command changes the working directory on  the  remote  host.   Use
  462.      this  command  to  move  to different areas on the remote server.  If you
  463.      just opened a new site, you might be  in  the  root  directory.   Perhaps
  464.      there  was a directory called ``/pub/news/comp\.sources\.d'' that someone
  465.      told you about.  From the root directory, you could:
  466.  
  467.            cd pub
  468.            cd news
  469.            cd comp.sources.d
  470.  
  471.      or, more concisely,
  472.  
  473.            cd /pub/news/comp.sources.d
  474.  
  475.      Then, commands such as _g_e_t, _p_u_t, and _l_s could be used to refer  to  items
  476.      in that directory.
  477.  
  478.      Some shells in the _U_N_I_X environment have  a  feature  I  like,  which  is
  479.      switching to the previous directory.  Like those shells, you can do:
  480.  
  481.            cd -
  482.  
  483.      to change to the last directory you were in.
  484.  
  485.      The _c_l_o_s_e command disconnects you from the remote  server.   The  program
  486.      does this for you automatically when needed, so you can simply open other
  487.      sites or quit the program without worrying about closing  the  connection
  488.      by hand.
  489.  
  490.      Sometimes it may be necessary to use the _c_r_e_a_t_e command.  This  makes  an
  491.      empty file on the remote host.  This can be useful when you are unable to
  492.      contact the remote server's administrator, but hope someone in  the  know
  493.      will spot your file.  For example,
  494.  
  495.            create readline2.0.tar_is_corrupt
  496.  
  497.      might persuade someone to repost that file.
  498.  
  499.      The _d_e_b_u_g command is mostly for use by me and  the  testers.   You  could
  500.      type
  501.  
  502.            debug 1
  503.  
  504.      to turn debugging mode on.  Then you could see all messages  between  the
  505.      program and the remote server, and things I print only in debugging mode.
  506.      If you report a bug, I might ask you to send me  a  _t_r_a_c_e  file.   To  do
  507.      that, you would run the program, and then type
  508.  
  509.            debug trace 1
  510.  
  511.      And so I could see how the program was compiled, you would type
  512.  
  513.            version
  514.  
  515.  
  516.  
  517.  
  518.  
  519.                                     2.3.0                                    8
  520.  
  521.  
  522.  
  523. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  524.  
  525.  
  526.      After you quit the program, you could then send  me  an  email  with  the
  527.      contents  of  the ~/\._n_c_f_t_p/_t_r_a_c_e file, which would also have the version
  528.      information in it.
  529.  
  530.      The _d_i_r command prints a detailed directory listing.  It tries to  behave
  531.      like  _U_N_I_X's  ``/bin/ls -l'' command.  If the remote server seems to be a
  532.      _U_N_I_X host, you can also use  the  same  flags  you  would  with  _l_s,  for
  533.      instance
  534.  
  535.            dir -rt
  536.  
  537.      would try to act like
  538.  
  539.            /bin/ls -lrt
  540.  
  541.      would on _U_N_I_X.
  542.  
  543.      The _e_c_h_o command wouldn't seem very useful, but it can be  nice  for  use
  544.      with  the  program's macros.  It behaves like the equivalent command does
  545.      under a _U_N_I_X shell, but accepts some extra flags.  All ``percent''  flags
  546.      are fed through _s_t_r_f_t_i_m_e(4).  So you could type
  547.  
  548.            echo It is now %H:%M on %B %d.
  549.  
  550.      and you should get something like this printed on your screen:
  551.  
  552.            It is now 19:00 on January 22.
  553.  
  554.      There are also ``at'' flags, which the program expands:
  555.  
  556.            @H : Name of connected host
  557.            @D : Full pathname of remote current working directory
  558.            @J : Short name of remote current working directory
  559.            @N : Newline.
  560.            @n : Bookmark name of connected host
  561.  
  562.      Example:
  563.  
  564.            echo "Connected to @H at %H:%M." >> junk
  565.  
  566.      If you later looked at the contents of ``junk,'' it might say:
  567.  
  568.            Connected to sphygmomanometer.unl.edu at 20:37.
  569.  
  570.      The _g_e_t command copies files from the current working  directory  on  the
  571.      remote host to your machine's current working directory.  To place a copy
  572.      of ``README'' in your local directory, you could try:
  573.  
  574.            get README
  575.  
  576.      The _g_e_t command has some powerful features which are described below,  in
  577.      ``SPECIAL DOWNLOADING FEATURES.''
  578.  
  579.      The _b_o_o_k_m_a_r_k_s command runs the _B_o_o_k_m_a_r_k _E_d_i_t_o_r.   You  already  know  how
  580.      what that does, since you read the section above on it, right?
  581.  
  582.  
  583.  
  584.                                     2.3.0                                    9
  585.  
  586.  
  587.  
  588. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  589.  
  590.  
  591.      The _l_c_d command is the first of a few ``l'' commands that work  with  the
  592.      local  host.   This  changes  the  current working directory on the local
  593.      host.  If you want to download files into a  different  local  directory,
  594.      you could use _l_c_d to change to that directory and then do your downloads.
  595.  
  596.      Another local command that comes in handy is the _l_l_s command, which  runs
  597.      ``/bin/ls''  on  the local host and displays the results in the program's
  598.      window.  You can use the same flags with _l_l_s as you would in your command
  599.      shell, so you can do things like:
  600.  
  601.            lcd ~/doc
  602.            lls -lrt p*.txt
  603.  
  604.      The program also has a built-in interface to the  name  service  via  the
  605.      _l_o_o_k_u_p  command.   This  means  you  can lookup entries for remote hosts,
  606.      like:
  607.  
  608.            lookup cse.unl.edu ftp.cs.unl.edu sphygmomanometer.unl.edu
  609.  
  610.      prints:
  611.  
  612.            cse.unl.edu  129.93.33.1
  613.            typhoon.unl.edu  129.93.33.24
  614.            sphygmomanometer.unl.edu  129.93.33.126
  615.  
  616.      There is also a more detailed option, enabled with ``-v,'' i.e.:
  617.  
  618.            lookup -v cse.unl.edu ftp.cs.unl.edu
  619.  
  620.      prints:
  621.  
  622.            cse.unl.edu:
  623.                Name:     cse.unl.edu
  624.                Address:  129.93.33.1
  625.  
  626.            ftp.cs.unl.edu:
  627.                Name:     typhoon.unl.edu
  628.                Alias:    ftp.cs.unl.edu
  629.                Address:  129.93.33.24
  630.  
  631.      You can also give _I_P addresses, so this would work too:
  632.  
  633.            lookup 129.93.33.24
  634.  
  635.      prints:
  636.  
  637.            typhoon.unl.edu  129.93.33.24
  638.  
  639.      The _l_p_a_g_e command views a local file one page at a time.  By default, the
  640.      program uses your pager program to view the files.  You can choose to use
  641.      the built-in pager by using the ``-b'' flag.  Example:
  642.  
  643.            lpage -b ~/.ncftp/bookmarks
  644.  
  645.  
  646.  
  647.  
  648.  
  649.                                    2.3.0                                    10
  650.  
  651.  
  652.  
  653. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  654.  
  655.  
  656.      The _l_p_w_d command is prints the current local directory.  Use this command
  657.      when you forget where you are on your local machine.
  658.  
  659.      The _l_s command prints a brief directory listing.  It tries to behave like
  660.      _U_N_I_X's  ``/bin/ls -CF'' command.  If the remote server seems to be a _U_N_I_X
  661.      host, you can also use the same flags you would with _l_s, for instance
  662.  
  663.            ls -rt
  664.  
  665.      would try to act like
  666.  
  667.            /bin/ls -CFrt
  668.  
  669.      would on _U_N_I_X.
  670.  
  671.      The _m_k_d_i_r command tries to create a new directory  on  the  remote  host.
  672.      For many public archives, you won't have the proper access permissions to
  673.      do that.
  674.  
  675.      The _o_p_e_n command connects you to a remote host.   Many  times,  you  will
  676.      simply  open  a  host  without  using any flags, but nonetheless the _o_p_e_n
  677.      command has some flags to enable certain features.
  678.  
  679.      To force an anonymous open, use the ``-a'' flag.  On the  _f_t_p\._p_r_o_b_e\._n_e_t
  680.      machine,  which  is the official archive site for _N_c_F_T_P, I have a need to
  681.      use both anonymous logins and user logins.  The _B_o_o_k_m_a_r_k _E_d_i_t_o_r remembers
  682.      type  of login I used last, so if the last time was a user login, I could
  683.      use the ``-a'' flag to switch back to the anonymous  login  type  without
  684.      having to use the _B_o_o_k_m_a_r_k _E_d_i_t_o_r to change that.
  685.  
  686.      Likewise, I could use the ``-u'' flag to force a user open.  Then I could
  687.      give my account name and password to access that account.
  688.  
  689.      Many of the big archive sites like _w_u_a_r_c_h_i_v_e\._w_u_s_t_l\._e_d_u are busy, so you
  690.      aren't  guaranteed a connection to them.  The program lets you ``redial''
  691.      sites periodically, until a connection succeeds.  Use the ``-r'  flag  to
  692.      turn on automatic redial.
  693.  
  694.      Redial itself has a few parameters.  You can set the delay,  in  seconds,
  695.      of the time spent waiting between redials.  You can also have the program
  696.      give up after a maximum number of redials is reached.  Here's an  example
  697.      that fully utilizes redial mode:
  698.  
  699.      open -r -d 75 -g 10 bowser.nintendo.co.jp
  700.  
  701.      The ``-r'' turns on redialing, the ``-d'' sets the  redial  delay  to  75
  702.      seconds,  and the ``-g'' flag limits redialing to 10 tries.  If you like,
  703.      you can just trust the default redial settings and only use ``-r.''
  704.  
  705.      The _o_p_e_n command will run the _B_o_o_k_m_a_r_k  _E_d_i_t_o_r  if  you  don't  supply  a
  706.      hostname  to  open.  You can use the _B_o_o_k_m_a_r_k _E_d_i_t_o_r to select a host and
  707.      open it by hitting the _r_e_t_u_r_n key.
  708.  
  709.      The _p_a_g_e command lets you browse a remote file one page at a time.   This
  710.      is  useful  for  reading  README's on the remote host without downloading
  711.      them first.  This command uses whatever program you have  set  the  _p_a_g_e_r
  712.  
  713.  
  714.                                    2.3.0                                    11
  715.  
  716.  
  717.  
  718. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  719.  
  720.  
  721.      field in the _P_r_e_f_e_r_e_n_c_e_s screen to view the file.
  722.  
  723.      The _p_d_i_r and _p_l_s commands are equivalent to _d_i_r and _l_s respectively, only
  724.      they  feed  their output to your pager.  These commands are primarily for
  725.      _l_i_n_e _m_o_d_e because directory listings can scroll offscreen.  If you  do  a
  726.      normal  _l_s  while  in _v_i_s_u_a_l mode, if it would go offscreen, the built-in
  727.      pager kicks in automatically.  Therefore I don't recommend using _p_d_i_r and
  728.      _p_l_s while in _v_i_s_u_a_l mode.
  729.  
  730.      The _r_e_d_i_r and _p_r_e_d_i_r commands give you  a  way  to  re-display  the  last
  731.      directory  listing.  The program saves the output from the last _d_i_r or _l_s
  732.      command you did, so if you want to see it again you can do  this  without
  733.      wasting  network  bandwidth.   The  _p_r_e_d_i_r  command is the same as _r_e_d_i_r,
  734.      except that the output is fed to your pager.
  735.  
  736.      I have found that I mostly download, and have next to no need at  all  to
  737.      upload.  But the _p_u_t command is there in case you need to upload files to
  738.      remote hosts.  For example, if I wanted to send some files  to  a  remote
  739.      host, I could do:
  740.  
  741.            lcd ~/docs/files
  742.            put 02.txt 03.txt 05.txt 07.txt 11.txt
  743.  
  744.      The  _p_u_t  command  won't  work  if  you  don't  have  the  proper  access
  745.      permissions  on  the remote host.  Also, this command doesn't have any of
  746.      the special features that the _g_e_t command  has,  except  for  the  ``-z''
  747.      option.
  748.  
  749.      The _p_w_d command prints the current remote working directory.   In  _v_i_s_u_a_l
  750.      mode, this is in the status bar.
  751.  
  752.      If you need to change the name of a remote file, you can use  the  _r_e_n_a_m_e
  753.      command, like:
  754.  
  755.            rename SPHYGMTR.TAR sphygmomanometer-2.3.1.tar
  756.  
  757.      Of course, when you finish using  the  program,  type  _q_u_i_t  to  end  the
  758.      program (You could also use _b_y_e, _e_x_i_t, or ^_D).
  759.  
  760.      The _q_u_o_t_e command can be used to send a direct _F_T_P  _P_r_o_t_o_c_o_l  command  to
  761.      the  remote  server.  Generally this isn't too useful to the average user
  762.      (or me either).
  763.  
  764.      The _r_h_e_l_p command sends a help request to the remote server.  The list of
  765.      _F_T_P  _P_r_o_t_o_c_o_l  commands  is  often  printed,  and  sometimes  some  other
  766.      information  that  is  actually  useful,  like  how  to  reach  the  site
  767.      administrator.
  768.  
  769.      Depending on the remote server, you may be able to give  a  parameter  to
  770.      the server also, like:
  771.  
  772.            rhelp NLST
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.                                    2.3.0                                    12
  780.  
  781.  
  782.  
  783. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  784.  
  785.  
  786.      One server responded:
  787.  
  788.            Syntax: NLST [ <sp> path-name ]
  789.  
  790.      If you need to delete a remote file you can try the _r_m command.  Much  of
  791.      the  time  this  won't  work  because  you  won't  have the proper access
  792.      permissions.  This command doesn't accept any flags, so you can't nuke  a
  793.      whole tree by using ``-rf'' flags like you can on _U_N_I_X.
  794.  
  795.      Similarly, the _r_m_d_i_r command  removes  a  directory.   Depending  on  the
  796.      remote  server,  you  may  be able to remove a non-empty directory, so be
  797.      careful.
  798.  
  799.      The _s_e_t  command  is  provided  for  backward  compatibility  with  older
  800.      versions  of  the  program,  and is superseded by the _p_r_e_f_s command.  The
  801.      basic syntax is:
  802.  
  803.            set option value
  804.  
  805.      Where the option is the short name of  the  corresponding  field  in  the
  806.      _P_r_e_f_e_r_e_n_c_e_s  screen.   The  short  names of the preferences fields can be
  807.      found by browsing your ~/._n_c_f_t_p/_p_r_e_f_s file.  This command is  mainly  for
  808.      use with _l_i_n_e _m_o_d_e, but since that mode is no longer officially supported
  809.      by me, I want to discourage the use of this command.
  810.  
  811.      One obscure command you may  have  to  use  someday  is  _s_i_t_e.   The  _F_T_P
  812.      _P_r_o_t_o_c_o_l  allows for ``site specific'' commands.  These ``site'' commands
  813.      vary of course, but one common sub-command that is useful that some sites
  814.      support is _c_h_m_o_d, i.e.:
  815.  
  816.            site chmod 644 README
  817.  
  818.      Try doing one of these to see what the remote server supports, if any:
  819.  
  820.            rhelp SITE
  821.            site help
  822.  
  823.      You may need to change transfer types during the course of a session with
  824.      a server.  You can use the _t_y_p_e command to do this.  Try one of these:
  825.  
  826.            type ascii
  827.            type binary
  828.            type image
  829.  
  830.      If you ever need to contact me  about  the  program,  please  familiarize
  831.      yourself  with  the  _v_e_r_s_i_o_n  command.   This  command  dumps  a  lot  of
  832.      information that tells me which edition of the program you are using, and
  833.      how  it was installed on your system.  Here's a way to save the output of
  834.      this command to a file, so you can send it to me:
  835.  
  836.            version > version.txt
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.                                    2.3.0                                    13
  845.  
  846.  
  847.  
  848. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  849.  
  850.  
  851. SSSPPPEEECCCIIIAAALLL DDDOOOWWWNNNLLLOOOAAADDDIIINNNGGG FFFEEEAAATTTUUURRREEESSS
  852.      You probably already know that you use the _g_e_t command to copy  files  on
  853.      the  remote  host to the local host.  But the _g_e_t command has a few other
  854.      tricks that you might find useful.  First of all, _n_c_f_t_p skips  files  you
  855.      already have.  If you try to
  856.  
  857.            get file24
  858.  
  859.      and there is a file named  ``file24''  in  the  current  local  directory
  860.      already,  the  program uses some additional heuristics to determine if it
  861.      should actually waste network bandwidth to download it again.
  862.  
  863.      The program tries to get the date and size of the remote file ``file24.''
  864.      If  that  file  has  the  exact  same  date  and  size  as the local file
  865.      ``file24,'' the program will skip over that file.  If the  program  could
  866.      not  get  the  date  or size of the remote file, or the size differs, the
  867.      program will go ahead and fetch the file.
  868.  
  869.      In addition, if the local file's date is newer  than  the  remote  file's
  870.      date,  the  program  skips  the download because it concludes you already
  871.      have a more recent version.
  872.  
  873.      What all this means for you is that you can use  the  program  to  _m_i_r_r_o_r
  874.      another  archive.   For  example, you might have a task that requires you
  875.      keep a mirror of all the files of a remote  directory  called  ``files.''
  876.      In  that  directory,  there  might  be dozens of files, some of which are
  877.      updated occasionally.  You could use _n_c_f_t_p to help you out by setting the
  878.      appropriate local and remote directories, then simply doing:
  879.  
  880.            get *
  881.  
  882.      The program will skip over the old files, and  only  download  the  files
  883.      that you don't have or have been updated since the last time.
  884.  
  885.      Nonetheless, you may want to ignore the program's advice and  download  a
  886.      file  anyway, despite the program's thinking that you don't need to.  You
  887.      can use the ``-f'' flag with _g_e_t to force a download:
  888.  
  889.            get -f README
  890.  
  891.      You may also need to use the ``-C'' flag to force the program to continue
  892.      downloading  where  it  left off.  I sometimes call that feature ``forced
  893.      reget'' for historical reasons.
  894.  
  895.      You can also turn off _w_i_l_d_c_a_r_d _m_a_t_c_h_i_n_g with  _g_e_t  by  using  the  ``-G''
  896.      flag.  Other _F_T_P programs used the syntax
  897.  
  898.            get remote-file [local-file]
  899.  
  900.      which allowed you to specify a local  pathname  for  the  file  you  were
  901.      trying  to  download.  _N_c_F_T_P differs in that respect, and if you used the
  902.      older programs, you would find that the program's _g_e_t behaves  more  like
  903.      those other program's _m_g_e_t command.  This means that in _N_c_F_T_P,that
  904.  
  905.            get file01 file02
  906.  
  907.  
  908.  
  909.                                    2.3.0                                    14
  910.  
  911.  
  912.  
  913. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  914.  
  915.  
  916.      tries to download remote files named ``file01'' and ``file02.''   If  you
  917.      like, you can get that older behavior by using the ``-z'' flag, so:
  918.  
  919.            get -z file01 ../junk/files/01.txt
  920.  
  921.      would get ``file01'' and use the local name ``\.\./junk/files/01\.txt.''
  922.  
  923.      Another thing that _g_e_t does is that you can use the ``-n'' flag to  fetch
  924.      files  that  are a certain number of days old or newer.  If you just want
  925.      to get the newest files at an archive, you  don't  have  to  use  a  full
  926.      mirror.   You  can  just  say ``download all files that are 3 days old or
  927.      newer.''  Do that by going to a directory, and trying:
  928.  
  929.            get -n 3 *
  930.  
  931.      The program also has ``reget'' mode built into the  _g_e_t  command.   Other
  932.      FTP  programs  provided a _r_e_g_e_t command, which was useful when you lost a
  933.      connection during a download.  Instead of the remote host  resending  the
  934.      entire  file,  you  could  use the _r_e_g_e_t command to continue the transfer
  935.      where it was cut off.
  936.  
  937.      _N_c_F_T_P has this capability built-in, and it examines the date and size  of
  938.      the  remote  file  and  local  file  to  determine  if the program should
  939.      continue where it left off last time.  If the dates are the same, but the
  940.      local file is smaller, the program attempts to ``reget.''
  941.  
  942.      The last, and most wasteful feature of _g_e_t is recursive  mode,  which  is
  943.      turned on with the ``-R'' flag.  This feature lets you download an entire
  944.      directory's contents, i.e.:
  945.  
  946.            get -R /pub/info/help
  947.  
  948.      That  creates  a  directory  called  ``./help''  in  the  current   local
  949.      directory, and copies all files and subdirectories into it.
  950.  
  951.      Please use some discretion  with  this  feature.   If  you  get  a  large
  952.      directory,   you   could  really  bog  down  the  remote  host.   Archive
  953.      administrators are providing a public service, so don't abuse the archive
  954.      so  much that they have to shut down public access because the real users
  955.      of that archive can't get their work done.
  956.  
  957. MMMAAACCCRRROOOSSS
  958.  
  959.      The program has a simple macro/alias facility.  You  can  use  macros  to
  960.      roll your own commands, or do things when certain events happen.
  961.  
  962.      To use macros, you will need to create and edit the _m_a_c_r_o_s file  in  your
  963.      ._n_c_f_t_p  subdirectory  of your home directory.  Your ~/._n_c_f_t_p directory is
  964.      created for you automatically the first time you run the program, but you
  965.      have  to make the _m_a_c_r_o_s file yourself since most users won't have a need
  966.      for them.
  967.  
  968.      You can have any number of macros.  The syntax is:
  969.  
  970.            macro macro-name
  971.                macro-body...
  972.  
  973.  
  974.                                    2.3.0                                    15
  975.  
  976.  
  977.  
  978. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  979.  
  980.  
  981.            end
  982.  
  983.      Here's a simple macro that users of the old _f_t_p program might appreciate:
  984.  
  985.            macro binary
  986.                type i
  987.            end
  988.  
  989.      You could run that macro simply by running the  program  and  typing  the
  990.      macro name as if it were a regular _n_c_f_t_p command.
  991.  
  992.      Macros can also  have  parameters,  much  like  the  _K_o_r_n  _S_h_e_l_l's  shell
  993.      functions  and  the _C-_S_h_e_l_l's aliases.  These parameters are sent to your
  994.      macro, and if your macro uses the appropriate ``dollar'' variables,  they
  995.      are expanded.  To illustrate, try this macro:
  996.  
  997.            macro cdls
  998.                cd $1
  999.                ls
  1000.            end
  1001.  
  1002.      To run that macro, open a connection and try:
  1003.  
  1004.            cdls /pub
  1005.  
  1006.      That would try to _c_d to /pub, and then try to list its contents with _l_s.
  1007.  
  1008.      Dollar variables are somewhat like those in the _B_o_u_r_n_e and  _K_o_r_n  shells.
  1009.      Example syntax:
  1010.  
  1011.            $4     :  Argument 4
  1012.            $*     :  All arguments.
  1013.            $@     :  All arguments, each of them surrounded by double quotes.
  1014.            $(2-5) :  Arguments 2, 3, 4, and 5.
  1015.            $(2,5) :  Arguments 2 and 5.
  1016.            $(3+)  :  Arguments 3, 4, 5, ..., N.
  1017.  
  1018.      A better way to code the ``cdls'' macro might be:
  1019.  
  1020.            macro cdls
  1021.                cd $1
  1022.                ls $(2+)
  1023.            end
  1024.  
  1025.      There are some special macros, which I call _e_v_e_n_t  _m_a_c_r_o_s.   The  program
  1026.      looks for macros by special names, and if they exist, runs the macro when
  1027.      that event happens.
  1028.  
  1029.      One event macro is the ._s_t_a_r_t._n_c_f_t_p macro.  If you have a macro  by  that
  1030.      name  defined  in  your macros file, the program will run that macro each
  1031.      time you run the program.
  1032.  
  1033.      Similarly, there is also a ._q_u_i_t._n_c_f_t_p macro that is run  each  time  you
  1034.      quit the program.
  1035.  
  1036.  
  1037.  
  1038.  
  1039.                                    2.3.0                                    16
  1040.  
  1041.  
  1042.  
  1043. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  1044.  
  1045.  
  1046.      Another set of event macros are site-specific.  For example, if I have  a
  1047.      site   bookmarked  as  ``typhoon''  I  could  then  define  macros  named
  1048.      ._o_p_e_n._t_y_p_h_o_o_n and ._c_l_o_s_e._t_y_p_h_o_o_n which would run each time I  opened  and
  1049.      closed ``typhoon.''
  1050.  
  1051.      Another,  more  generic  set  of  event  macros  are  the  ._o_p_e_n._a_n_y  and
  1052.      ._c_l_o_s_e._a_n_y  macros which run when I open or close any site.  One possible
  1053.      use for these macros  is  to  run  separate  shell  scripts  to  do  some
  1054.      processing  after  you  finish  using  a site.  I could have a macro like
  1055.      this:
  1056.  
  1057.            macro .quit.ncftp
  1058.                echo "Started post-processing downloads at %H:%M:%S"
  1059.                !sh ~/scripts/download-decoder
  1060.                echo "Finished post-processing downloads at %H:%M:%S"
  1061.            end
  1062.  
  1063.      Another use is to duplicate the old _m_a_c_d_e_f _i_n_i_t hack that the traditional
  1064.      _f_t_p program used in its ._n_e_t_r_c file.  For example:
  1065.  
  1066.            macro .open.infomac
  1067.                echo "Getting recent files list"
  1068.                get -z /pub/info-mac/help/recent-files ~/docs/recent
  1069.                ls -lrt
  1070.            end
  1071.  
  1072. UUUSSSIIINNNGGG CCCOOOLLLOOONNN MMMOOODDDEEE
  1073.      The _c_o_l_o_n-_m_o_d_e feature is used from your shell's command line.
  1074.  
  1075.      In ancient times, way back during the Disco Era, you could use a  program
  1076.      called  _t_f_t_p  to  fetch  a  file using the Internet standard _T_r_i_v_i_a_l _F_i_l_e
  1077.      _T_r_a_n_s_f_e_r _P_r_o_t_o_c_o_l. You could use that program to do something  like  this
  1078.      from within its shell:
  1079.  
  1080.            get wuarchive.wustl.edu:/graphics/gif/README
  1081.  
  1082.      and that would call wuarchive and fetch the README file.
  1083.  
  1084.      You can use this program to do the same thing from your  shell's  command
  1085.      line:
  1086.  
  1087.            csh> ncftp wuarchive.wustl.edu:/graphics/gif/README
  1088.            csh> head README
  1089.  
  1090.      This tells your shell, in this case the _C-_s_h_e_l_l to run _N_c_F_T_P, which would
  1091.      open  wuarchive, fetch /graphics/gif/README and write the file /README in
  1092.      the current working directory, and then exits.
  1093.  
  1094.      The _c_o_l_o_n-_m_o_d_e feature is nice if you don't want  to  browse  around  the
  1095.      remote  site, and you know exactly want you want.  It also comes in handy
  1096.      in shell scripts, where you don't want to enter the  command  shell,  and
  1097.      might not want the program to spew output.
  1098.  
  1099.      You can use the _U_n_i_f_o_r_m _R_e_s_o_u_r_c_e _L_o_c_a_t_o_r  standard  also.   For  example,
  1100.      this would work:
  1101.  
  1102.  
  1103.  
  1104.                                    2.3.0                                    17
  1105.  
  1106.  
  1107.  
  1108. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  1109.  
  1110.  
  1111.            csh> ncftp ftp://wuarchive.wustl.edu/graphics/gif/README
  1112.  
  1113.      There are times where you might not want the program to  write  a  _c_o_l_o_n-
  1114.      _m_o_d_e  file  in the current working directory, or perhaps you want to pipe
  1115.      the output of a remote file into something else.  _C_o_l_o_n-_m_o_d_e has  options
  1116.      to do this.  It was inspired by the guy who wrote the _f_t_p_c_a_t perl script.
  1117.      The ``-c'' option tells the program  to  write  on  the  standard  output
  1118.      stream.   The ``-m'' option pipes the file into your pager (like _m_o_r_e) Of
  1119.      course this won't work if the thing you give _c_o_l_o_n-_m_o_d_e is  a  directory!
  1120.      This example just dumps a remote file to stdout:
  1121.  
  1122.            csh> ncftp -c wuarc:/graphics/gif/README
  1123.  
  1124.      This example redirects a remote file into a different location:
  1125.  
  1126.            csh> ncftp -c wu:/README > ~pdietz/thesis.tex
  1127.  
  1128.      This one shows how to use a pipeline:
  1129.  
  1130.            csh> ncftp -c wuarc:/README | tail | wc -l
  1131.            10
  1132.            csh>
  1133.  
  1134.      This shows how to page a remote file:
  1135.  
  1136.            csh> ncftp -m wuarc:/graphics/gif/README
  1137.  
  1138. UUUSSSIIINNNGGG LLLIIINNNEEE MMMOOODDDEEE
  1139.  
  1140.      The only reason I provide _l_i_n_e _m_o_d_e is so that  the  primitive  operating
  1141.      systems whose _c_u_r_s_e_s library is missing or dysfunctional won't render the
  1142.      program completely useless.
  1143.  
  1144.      exceptions of the  functions  that  require  _v_i_s_u_a_l  _m_o_d_e,  such  as  the
  1145.      _P_r_e_f_e_r_e_n_c_e_s  screen  and  the _B_o_o_k_m_a_r_k _E_d_i_t_o_r.  You will have to edit the
  1146.      ~/._n_c_f_t_p/_p_r_e_f_s and ~/._n_c_f_t_p/_b_o_o_k_m_a_r_k_s file manually, with a text editor.
  1147.  
  1148.      As a small consolation, you get  to  use  the  full-powered  line-editing
  1149.      libraries, like _G_N_U _R_e_a_d_l_i_n_e if they were compiled with the program.
  1150.  
  1151. SSSUUUMMMMMMAAARRRYYY OOOFFF CCCOOOMMMMMMAAANNNDDD LLLIIINNNEEE OOOPPPTTTIIIOOONNNSSS
  1152.  
  1153.      When you invoke the program from your shell, there are ``dash flags'' you
  1154.      can use like you can with most other _U_N_I_X programs.
  1155.  
  1156.      Here's a list of options you can use from the command line:
  1157.  
  1158.            -D : Turns on debugging mode and tracing.
  1159.            -V : Uses ``visual'' mode for this session.
  1160.            -L : Uses ``line mode'' for this session.
  1161.            -H : Prints the information from the ``version'' command and exits.
  1162.  
  1163.      When you turn on  tracing,  the  program  writes  a  log  with  debugging
  1164.      information  to  a  file called _t_r_a_c_e in your ._n_c_f_t_p subdirectory of your
  1165.      home directory.  If you need to report a bug, it would be helpful to mail
  1166.      me the _t_r_a_c_e file so I can track it down better.
  1167.  
  1168.  
  1169.                                    2.3.0                                    18
  1170.  
  1171.  
  1172.  
  1173. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  1174.  
  1175.  
  1176.      In addition to the program flags, you can also use flags  from  the  _o_p_e_n
  1177.      and  _g_e_t  commands  with  a  _c_o_l_o_n  _m_o_d_e  path.   Here's a really complex
  1178.      example:
  1179.  
  1180.            csh> ncftp -r -d 120 -n 3 sphygmomanometer.unl.edu:/pub/stuff/*
  1181.  
  1182.      This tries redialing that host every two minutes, and fetching all  files
  1183.      from the ``/pub/stuff'' directory that are 3 days old or newer.
  1184.  
  1185. AAAUUUTTTHHHOOORRR
  1186.      _N_c_F_T_P was  written  by  Mike  Gleason,  _N_C_E_M_R_S_o_f_t  (mgleason@probe\.net).
  1187.      _N_c_F_T_P is copyrighted 1995 by NCEMRSoft.  All rights reserved.
  1188.  
  1189.      As of this writing, the most recent version is archived in /pub/ncftp, on
  1190.      _f_t_p\._p_r_o_b_e\._n_e_t.
  1191.  
  1192. TTTHHHAAANNNKKKSSS
  1193.  
  1194.      Ideas and some code contributed by  my  partner,  Phil  Dietz,  _N_C_E_M_R_S_o_f_t
  1195.      (dietz@wtc\.com).
  1196.  
  1197.      Thanks to everyone who has helped test the program, and sent in  feedback
  1198.      over the years.  Your support is what drives me to improve the program!
  1199.  
  1200.      I'd like to thank my former system administrators, most  notably  Charles
  1201.      Daniel, for making testing on a variety of platforms possible, letting me
  1202.      have some extra disk space, and for maintaining the UNL FTP site.
  1203.  
  1204.      I also thank Dale Botkin and Tim Russell at _P_r_o_b_e _T_e_c_h_n_o_l_o_g_y, for  giving
  1205.      _n_c_f_t_p  a  home  on  _p_r_o_b_e\._n_e_t,  the  midwest's  best  connection  to the
  1206.      internet.
  1207.  
  1208.      For testing above and beyond the call of duty, I am  especially  grateful
  1209.      to:   Phil  Dietz,  Kok  Hon  Yin (hkok@cse\.unl\.edu), Andrey A. Chernov
  1210.      (ache@astral\.msk\.su).
  1211.  
  1212.      Thanks to  Tim  MacKenzie  (t\.mackenzie@trl\.oz\.au)  for  the  filename
  1213.      completion code.
  1214.  
  1215.      Thanks to DaviD W. Sanderson (dws@ssec\.wisc\.edu), for  helping  me  out
  1216.      with the man page.
  1217.  
  1218. BBBUUUGGGSSS
  1219.  
  1220.      Due to a limitation in the _c_u_r_s_e_s  library,  scrolling  may  be  slow  in
  1221.      visual mode.
  1222.  
  1223.      Shell escapes, suspending (^Z) and resuming, and interruping  (^C)  still
  1224.      have quirks with _v_i_s_u_a_l _m_o_d_e.
  1225.  
  1226.      There   are   no   such   sites   named    _b_o_w_s_e_r\._n_i_n_t_e_n_d_o\._c_o\._j_p    or
  1227.      _s_p_h_y_g_m_o_m_a_n_o_m_e_t_e_r\._u_n_l\._e_d_u.
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.                                    2.3.0                                    19
  1235.  
  1236.  
  1237.  
  1238. NcFTP(1)                   Unix Programmer's Manual                   NcFTP(1)
  1239.  
  1240.  
  1241. SSSEEEEEE AAALLLSSSOOO
  1242.      _f_t_p(1), _f_t_p_d(8), _n_s_l_o_o_k_u_p(1), _a_r_c_h_i_e(1), _r_c_p(1), _t_f_t_p(1).
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264.  
  1265.  
  1266.  
  1267.  
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280.  
  1281.  
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.                                    2.3.0                                    20
  1300.  
  1301.